package org.example.yidaiyilu.entity;

import java.util.ArrayList;
import java.util.List;

public class BianXi {

    private String[] keys = null;
    private String content;

    public BianXi(String text){
        String text1 = text.split(" ")[0];
        this.keys = text1.replace("◎","").split("—");
        this.content = text.replace(text1, "");
    }

    public String[] getKeys() {
        return keys;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String toString(){
        StringBuilder sb = new StringBuilder();
        sb.append("<辨析>");
        if(keys != null && keys.length > 0) {
            for (int i = 0; i < keys.length; i++) {
                sb.append("<词目>").append(keys[i]).append("</词目>");
            }
        }
        if(content != null && !"".equals(content)){
            sb.append("<文本>").append(content).append("</文本>");
        }

        sb.append("</辨析>");
        return sb.toString();
    }


}
